from common.utils import blogDriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

#首页测试
class list:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://8.137.19.140:9090/blog_list.html"
        self.driver = blogDriver.driver
        self.driver.get(self.url)

    #登录状态
    def list_test01(self):
        #用户名称
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container > div.left > div > h3")

        #主页按钮
        self.driver.find_element(By.CSS_SELECTOR, "body > div.nav > a:nth-child(4)")

        #写博客按钮
        self.driver.find_element(By.CSS_SELECTOR, "body > div.nav > a:nth-child(5)")

        #注销按钮
        self.driver.find_element(By.CSS_SELECTOR, "body > div.nav > a:nth-child(6)")


    #未登录状态
    def list_test02(self):
        #是否为登录页面
        self.driver.find_element(By.CSS_SELECTOR, "body > div.container-login > div > h3")

